import request from "@/request/index.js";
//获取房东的所有房源列表（条件查询）

export function getAvailability(communityId, rentState, searchValue) {
	return request(
		`/front/landlord/room/list?communityId=${communityId}&rentState=${rentState}&searchValue=${searchValue}`,
		'get', null)
}

// 获取房东已录入的小区列表

export function houseAll() {
	return request(`/front/house/community/add`, 'get', null)
}

// 根据房源编号获取房源详情拼接参数

export function HouseDetail(id) {
	return request(`/front/landlord/room/${id}`, 'get', null)
}

// 获取房东的房源数量


export function getHouseTotal() {
	return request(`/front/landlord/room/quantity`, 'get', null)
}
//查询要修改的详情
export function getFindUpdateLease(id){
	return request(`/front/landlord/lease/findUpdateLease/${id}` ,'get',null)
}
//修改租约
export function getUpdateLease(data){
	
	return request(`/front/landlord/lease/updateLease`,'post',data)
}

// 批量修改房源出租状态

export function putHouseLeaseSatate(idList) {
	return request(`/front/landlord/room/all/${idList}`, 'put', null)
}
//修改房源列表房号
export function editHouseDetail(data) {
	return request(`/front/landlord/room/updateHouseBuildUnitVerNumber`, 'post', data)
}

//  新增媒体资源列表

export function addMedia(data) {
	return request(`/front/media/all`, 'post', data)
}

// 修改房源信息要先获取房源详情然后修改

export function putDetail(data) {
	return request(`/front/landlord/room`, 'put', data)
}
export function landlordLeaseHouse(id) {
	return request(`/front/landlord/lease/${id}`, 'get', null)
}

// /front/landlord/lease/house/120

export function getHouseLeaseDetail(id) {
	return request(`/front/landlord/lease/house/${id}`, 'get', null)
}

// 删除租约
export function deleteLease(id) {
	return request(`/front/landlord/lease/${id}`, 'delete', null)
}

// /front/landlord/survey/publish

export function openSurvey(id) {
	return request(`/front/landlord/survey/publish/${id}`, 'post', null)
}
export function cancleSurvey(id) {
	return request(`/front/landlord/survey/canclePublish/${id}`, 'post', null)
}
//驳回经纪人勘验结果，计入业绩
export function agreeSurveySucc(id) {
	return request(`/front/landlord/survey/agreeSurveySucc/${id}`, 'post', null)
}
//驳回经纪人勘验结果
export function rejectSurvey(id) {
	return request(`/front/landlord/survey/rejectSurvey/${id}`, 'post', null)
}

//删除房源
export function deleteHouseRoom(houseId) {
	return request(`/front/landlord/room/delHouseRoom/${houseId}`, 'get', null)
}
//查询服务器app版本
export function getServerAppVersion(id) {
	if (uni.getSystemInfoSync().platform == 'android') {
		console.log('我是安卓')
		return request(`/front/queryVersion?appClient=1&devType=android`, 'get', null)
	}else{
	    console.log('我是IOS')
		return request(`/front/queryVersion?appClient=1&devType=ios`, 'get', null)
	}
}
